package com.fiap.to;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.PrePersist;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "AM_SERVICO")
public class ServicoTO implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GenericGenerator(name = "seq_servico", strategy = "increment")
	@GeneratedValue(generator = "seq_servico")
	@Column(name = "ID_SERVICO")
	private int id_servico;
	@Column(length = 8, precision = 2)
	private double valor;
	@Column(length = 255)
	private String descricao;

	@PrePersist
	private void executaAntesDePersistir() {
		System.out.println("Persistindo...");
	}

	public ServicoTO() {
		super();
		// TODO Auto-generated constructor stub
	}

	public ServicoTO(int id_servico, double valor, String descricao) {
		super();
		this.id_servico = id_servico;
		this.valor = valor;
		this.descricao = descricao;
	}

	public int getId_servico() {
		return id_servico;
	}

	public void setId_servico(int id_servico) {
		this.id_servico = id_servico;
	}

	public double getValor() {
		return valor;
	}

	public void setValor(double valor) {
		this.valor = valor;
	}

	public String getDescricao() {
		return descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

}
